import { GlobalOutlined } from '@ant-design/icons';
import { Menu, Dropdown } from 'antd';
import { setLocale } from '@umijs/max';

const SelectLang: React.FC = () => {
  const langMenu = (
    <Menu>
      <Menu.Item key="zh-CN" onClick={() => setLocale('zh-CN')}>
        简体中文
      </Menu.Item>
      <Menu.Item key="en-US" onClick={() => setLocale('en-US')}>
        English
      </Menu.Item>
    </Menu>
  );

  return (
    <Dropdown overlay={langMenu}>
      <GlobalOutlined />
    </Dropdown>
  );
}; 